<template>
  <div class="p-5px box-border rounded bg-red-600 text-light-50 cursor-pointer"
       @click="dialogActive = true">解散团队
  </div>
  <dialog-view title="解散团队" v-model:active="dialogActive" :height="200" @submit="onDismiss">
    <div class="h-full center~ text-sm">
      <div>你为当前团队群主，是否解散当前团队？</div>
    </div>
  </dialog-view>
</template>

<script setup lang="ts">
import {ref} from "vue";
import DialogView from "@/components/viewComponents/DialogView.vue";
import router from "@/router";

interface Props {
  userId: number
  leaderId: number
  groupId: number
}

const rawProps = defineProps<Props>()
const {userId, leaderId, groupId} = toRefs(rawProps)

const dialogActive = ref(false)

function onDismiss() {
  dismissGroup(leaderId.value, groupId.value, () => {
    router.push("/groupExhibition")
  }, (message) => {
    console.log(message)
  })
}
</script>

<style scoped>

</style>